package com.chenshu.controller;

import com.chenshu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-03-30
 * Time：15:27
 */

@Controller
public class UserController {

//    @Resource
    private UserService userService;

    //setter注入
    @Resource
    public void setUserService(UserService userService) {
        this.userService = userService;
    }


    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
    }

    public void doController() {
        userService.doService();
        System.out.println("Do User Controller.");
    }
}
